const { defineConfig } = require("@vue/cli-service");
const webpack = require("webpack");

module.exports = defineConfig({
  transpileDependencies: true,
  configureWebpack: {
    devtool: "source-map",
    plugins: [
      new webpack.DefinePlugin({
        __VUE_PROD_HYDRATION_MISMATCH_DETAILS__: "false",
      }),
    ],
  },
  devServer: {
    client: {
      overlay: false, // 关闭浏览器错误提示
    },
    proxy: {
      "/ntt-file-check": {
        // target: "http://192.168.3.37:8080", // 后端地址
        // target: "http://10.8.24.222:8080", // wy后端地址
        target: "http://192.168.3.36:8080", // yjl后端地址
        // pathRewrite: { "^/ntt-file-check": "" }, // 关键：重写路径，去掉 /api 前缀
        changeOrigin: true, // 解决跨域，必需
      },
    },
  },
  chainWebpack: (config) => {
    config.plugin("html").tap((args) => {
      args[0].title = "文件查重工具"; // 设置标题
      return args;
    });
  },
});
